package com.tmxk.day01.lifeng.demo4;

public class Bird extends Pet{
	private String hobby;
	public String getHobby() {
		return hobby;
	}
	public void setHobby(String hobby) {
		this.hobby = hobby;
	}
	public Bird() {
	}
	public Bird(String name) {
		super();
		super.setName(name);
	}
	public Bird(String name, int age, String strain, String hobby) {
		//super();显式调用父类无参构造
		super(name,age,strain);  //通过构造赋值,这一行等于下面三行
		//super.setName(name);
		//super.setAge(age);
		//super.setStrain(strain);
		this.hobby = hobby;
	}
	public void shout() {
		System.out.println(super.getName() + "在吱吱的叫");
	}
	public void fly() {
		System.out.println(super.getName() + "天天飞");
	}
	public void showInfo() {
		System.out.println("宠物的基本信息: 昵称是:" + super.getName() +" ,年龄是: " + super.getAge() + 
				" ,种类是: " + super.getStrain() +",爱好是:" +this.hobby);
	}
}
